<?php

$form = $this->beginWidget ( 'bootstrap.widgets.TbActiveForm', array (
		'id' => 'challenge-form',
		'enableAjaxValidation' => false 
) );
?>

<p class="help-block"><?php echo Yii::t('FieldsMessage', 'required_fields');?></p>
<br />


<?php echo $form->errorSummary(array($proposal,$content, $model)); ?>

<!-- Render Proposal Form -->

<?php echo $this->renderPartial('/proposal/_external_form', array('proposal'=>$proposal,'form'=>$form)); ?>

<!-- Render Proposal Content Form -->
<?php echo $this->renderPartial('/content/_form', array('form'=>$form,'model'=>$content));?>
<br/>
<!-- Render the source text -->
<?php echo $this->renderPartial('/source/dinamic_form',array('form'=>$form,'sources'=>$sources,'hasSource'=>$hasSource));?>

<!-- Render Challenge Form -->
<?php echo $this->renderPartial('_challenge_form', array('model'=>$model, 'form'=>$form)); ?>

<!-- Render Challenged Selector -->
<br/>
<?php if(!$areDifferent) { ?>
	<p style="color: #b94a48;">Usuário desafiado não pode ser Mediador do Desafio.</p>
<?php }?>

<?php echo $this->renderPartial('/user/_user_selector', array('challenged'=>$challenged, 'hasContent'=>$hasContent));?>



<div class="form-actions" align="center">
		<?php
		
		$this->widget ( 'zii.widgets.jui.CJuiButton', array (
				'id' => 'btnSubmit',
			'buttonType' => 'submit',
			'name' => 'btnSubmit',
			'value' => '1',
			'caption' => '  Concluir  ',
			'htmlOptions' => array('class' => 'btn btn-primary')
		) );
		?>
</div>

<?php $this->endWidget(); ?>
